package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CarMaintainMapper;
import com.ruoyi.system.domain.CarMaintain;
import com.ruoyi.system.service.ICarMaintainService;

/**
 * 汽车维护Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-09-09
 */
@Service
public class CarMaintainServiceImpl implements ICarMaintainService 
{
    @Autowired
    private CarMaintainMapper carMaintainMapper;

    /**
     * 查询汽车维护
     * 
     * @param id 汽车维护主键
     * @return 汽车维护
     */
    @Override
    public CarMaintain selectCarMaintainById(Long id)
    {
        return carMaintainMapper.selectCarMaintainById(id);
    }

    /**
     * 查询汽车维护列表
     * 
     * @param carMaintain 汽车维护
     * @return 汽车维护
     */
    @Override
    public List<CarMaintain> selectCarMaintainList(CarMaintain carMaintain)
    {
        return carMaintainMapper.selectCarMaintainList(carMaintain);
    }

    /**
     * 新增汽车维护
     * 
     * @param carMaintain 汽车维护
     * @return 结果
     */
    @Override
    public int insertCarMaintain(CarMaintain carMaintain)
    {
        carMaintain.setCreateTime(DateUtils.getNowDate());
        return carMaintainMapper.insertCarMaintain(carMaintain);
    }

    /**
     * 修改汽车维护
     * 
     * @param carMaintain 汽车维护
     * @return 结果
     */
    @Override
    public int updateCarMaintain(CarMaintain carMaintain)
    {
        carMaintain.setUpdateTime(DateUtils.getNowDate());
        return carMaintainMapper.updateCarMaintain(carMaintain);
    }

    /**
     * 批量删除汽车维护
     * 
     * @param ids 需要删除的汽车维护主键
     * @return 结果
     */
    @Override
    public int deleteCarMaintainByIds(Long[] ids)
    {
        return carMaintainMapper.deleteCarMaintainByIds(ids);
    }

    /**
     * 删除汽车维护信息
     * 
     * @param id 汽车维护主键
     * @return 结果
     */
    @Override
    public int deleteCarMaintainById(Long id)
    {
        return carMaintainMapper.deleteCarMaintainById(id);
    }
}
